function Progressbar(){
	
	
};

Progressbar.prototype.criandoProgressbar = function(seletorProgressbar, classProgressLabel, seletorCorpo){
	
	var progressbar = $(seletorProgressbar), progressLabel = $(classProgressLabel), corpo = $(seletorCorpo);

		progressbar.progressbar({
			
			value : false,
			change : function() {
				
				progressLabel.text(progressbar.progressbar("value") + "%");
				
			},
			
			complete: function(){
				
				progressLabel.text("Completo!");
			}
		});
				

		function progress() {
			
			var val = progressbar.progressbar("value") || 0;

			progressbar.progressbar("value", val + 15);
			
			if (val < 99) {
				
				setTimeout(progress, 80);
				
			};
			
			if(val == 100){
				
				progressbar.remove();
				corpo.show();
			};
		}

		setTimeout(progress, 2000);
};	    

Progressbar.prototype.desativarCorpo = function(seletorCorpo){
	
	$(seletorCorpo).hide(true);
	
};


var progressbar = new Progressbar();